import { assertType, describe, expectTypeOf, it } from 'vitest';
import { Config, CompileOptions, CompileOptionAirMode } from '../types/index';

describe('Test Config Types', () => {
  it('should have correct Config type', () => {
    expectTypeOf<Config>().toBeObject();
    expectTypeOf<Config>().toHaveProperty('absoluteInContentBound').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('asyncRedirect').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('autoExpose').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('CSSAlignWithLegacyW3C').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('customCSSInheritanceList').toEqualTypeOf<string[] | undefined>();
    expectTypeOf<Config>().toHaveProperty('dataStrictMode').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('disableLongpressAfterScroll').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('disableQuickTracingGC').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableA11y').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableAccessibilityElement').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableAirDetectRemovedKeysWhenUpdateData').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableAsyncInitVideoEngine').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableAsyncRequestImage').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableAsyncResolveSubtree').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableCheckExposureOptimize').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableCheckLocalImage').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableCircularDataCheck').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableComponentAsyncDecode').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableComponentLifecycleAlignWebview').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableComponentNullProp').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableCreateViewAsync').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableCSSInheritance').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableCSSInlineVariables').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableCSSLazyImport').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableCSSStrictMode').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableDisexposureWhenLynxHidden').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableEndGestureAtLastFingerUp').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableEventHandleRefactor').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableEventThrough').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableExposureUIMargin').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableExposureWhenLayout').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableExposureWhenReload').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableFiberElementForRadonDiff').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableFixedNew').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableHarmonyVisibleAreaChangeForExposure').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableICU').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableImageDownsampling').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableJsBindingApiThrowException').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableJSDataProcessor').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableListMoveOperation').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableListNewArchitecture').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableListPlug').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableLynxScrollFluency').toEqualTypeOf<boolean | number | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableMicrotaskPromisePolyfill').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableMultiTouch').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableMultiTouchParamsCompatible').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableNativeList').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableNewAnimator').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableNewClipMode').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableNewGesture').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableNewImage').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableNewIntersectionObserver').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableNewListContainer').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableNewTransformOrigin').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enablePlatformGesture').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableQueryComponentSync').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableReactOnlyPropsId').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableReduceInitDataCopy').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableReloadLifecycle').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableRemoveComponentExtraData').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableReuseLoadScriptExports').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableSignalAPI').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableSimultaneousTap').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableTextBoringLayout').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableTextGradientOpt').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableTextLanguageAlignment').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableTextLayerRender').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableTextLayoutCache').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableTextNonContiguousLayout').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableTextOverflow').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableTextRefactor').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableTouchRefactor').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableUIOperationOptimize').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableUnifiedPipeline').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableUseContextPool').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableUseMapBuffer').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableViewReceiveTouch').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableVsyncAlignedFlush').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableXTextLayoutReused').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('extendedLayoutOnlyOpt').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('extraInfo').toEqualTypeOf<Record<string, unknown> | undefined>();
    expectTypeOf<Config>().toHaveProperty('flatten').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('fontScaleEffectiveOnlyOnSp').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('implicit').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('includeFontPadding').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('keyboardCallbackPassRelativeHeight').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('lepusGCThreshold').toEqualTypeOf<number | undefined>();
    expectTypeOf<Config>().toHaveProperty('lepusNullPropAsUndef').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('lepusQuickjsStacksize').toEqualTypeOf<number | undefined>();
    expectTypeOf<Config>().toHaveProperty('lepusStrict').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('longPressDuration').toEqualTypeOf<number | undefined>();
    expectTypeOf<Config>().toHaveProperty('mapContainerType').toEqualTypeOf<number | undefined>();
    expectTypeOf<Config>().toHaveProperty('observerFrameRate').toEqualTypeOf<number | undefined>();
    expectTypeOf<Config>().toHaveProperty('pipelineSchedulerConfig').toEqualTypeOf<number | undefined>();
    expectTypeOf<Config>().toHaveProperty('preferredFps').toEqualTypeOf<string | undefined>();
    expectTypeOf<Config>().toHaveProperty('quirksMode').toEqualTypeOf<boolean | string | undefined>();
    expectTypeOf<Config>().toHaveProperty('removeDescendantSelectorScope').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('strictPropType').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('tapSlop').toEqualTypeOf<string | undefined>();
    expectTypeOf<Config>().toHaveProperty('trailNewImage').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('unifyVWVHBehavior').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('useImagePostProcessor').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('useNewSwiper').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('autoResumeAnimation').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('cli').toEqualTypeOf<string | undefined>();
    expectTypeOf<Config>().toHaveProperty('compileRender').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('customData').toEqualTypeOf<string | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableA11yIDMutationObserver').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableAsyncDisplay').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableBackgroundShapeLayer').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableCascadePseudo').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableCheckDataWhenUpdatePage').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableComponentLayoutOnly').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableGlobalComponentMap').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableNativeScheduleCreateViewAsync').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableNewAccessibility').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableNewLayoutOnly').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableOptPushStyleToBundle').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('enableOverlapForAccessibilityElement').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('fixCSSImportRuleOrder').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('forceCalcNewStyle').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('reactVersion').toEqualTypeOf<string | undefined>();
    expectTypeOf<Config>().toHaveProperty('redBoxImageSizeWarningThreshold').toEqualTypeOf<number | undefined>();
    expectTypeOf<Config>().toHaveProperty('removeComponentElement').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('syncImageAttach').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('useNewImage').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<Config>().toHaveProperty('version').toEqualTypeOf<string | undefined>();
  });
});

describe('Test Compile Options Types', () => {
  it('should have correct types', () => {
    expectTypeOf<CompileOptions>().toBeObject();
    expectTypeOf<CompileOptions>().toHaveProperty('debugInfoOutside').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('defaultDisplayLinear').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('defaultOverflowVisible').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('disableMultipleCascadeCSS').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('enableAirRawCSS').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('enableComponentConfig').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('enableCSSAsyncDecode').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('enableCSSClassMerge').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('enableCSSEngine').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('enableCssExternalClass').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('enableCSSInvalidation').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('enableCSSLazyDecode').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('enableCSSSelector').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('enableCSSStrictMode').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('enableCSSVariable').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('enableDynamicComponent').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('enableEventRefactor').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('enableFiberArch').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('enableFlexibleTemplate').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('enableKeepPageData').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('enableLepusChunkAsyncDecode').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('enableLynxAir').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('enableRadon').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('enableRemoveCSSScope').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('enableReuseContext').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('enableSimpleStyling').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('experimental_encodeQuickjsBytecode').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('forceCalcNewStyle').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('implicitAnimation').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('lynxAirMode').toEqualTypeOf<CompileOptionAirMode | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('removeCSSParserLog').toEqualTypeOf<boolean | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('targetSdkVersion').toEqualTypeOf<string | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('templateDebugUrl').toEqualTypeOf<string | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('trialOptions').toEqualTypeOf<Record<string, unknown> | undefined>();
    expectTypeOf<CompileOptions>().toHaveProperty('useLepusNG').toEqualTypeOf<boolean | undefined>();
  });
});
